package com.stlm2.dems.entity;

/**
 * Created by ZLQ on 2017/6/10.
 */
public enum FlowSource {


    ZuoDan(1) {
        public String toString() {
            return "做单";
        }
    },
    ChongZhi(2) {
        public String toString() {
            return "充值";
        }
    },
    DuiHuan(3) {
        public String toString() {
            return "积分兑换";
        }
    },
    DuiHuanNoPass(4) {
        public String toString() {
            return "积分兑换不通过";
        }
    },
    FanJiFen(5){
              public String toString() {return "抢红包";}//点击红包获取的也是送积分

    },
    ZhuanZhang(6){
        public String toString() {return "转账";}
    },
    Commission(7){
        public String toString(){return "推广佣金";}
    },
    Register(8){
        public String toString(){return "注册红包";}
    },
    ChouJiang(9){
        public String toString(){return "抽奖";}
    },
    Recharge(0) {
        public String toString() {
            return "充值";
        }
    },
    Buy(12) {
        public String toString() {
            return "购买";
        }
    },
    BuyRefund(10) {
        public String toString() {
            return "购买退款";
        }
    },
    StopBuying(30) {
        public String toString() {
            return "放弃购买";
        }
    },

    FreightInsurance(31) {
        public String toString() {
            return "运费赔偿金";
        }
    },
    RejectOrder(32) {
        public String toString() {
            return "驳回订单";
        }
    },
    complete(36){
        public String toString(){return "完成退款";}
    },
    GiveIntegral(37){
        public String toString(){return "赠送积分";}
    },
    ConvertIntegral(38){
        public String toString(){
            return "积分商品";
        }
    };

    private final int val;

    FlowSource(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static FlowSource getByIntValue(int n) {
        switch (n) {
            case 38:
                return ConvertIntegral;
            case 37:
                return GiveIntegral;
            case 0:
                return Recharge;
            case 12:
                return Buy;
            case 10:
                return BuyRefund;
            case 30:
                return StopBuying;
            case 31:
                return FreightInsurance;
            case 32:
                return RejectOrder;
            case 36:
                return complete;
            case 1:
                return  ZuoDan;
            case 2:
                return ChongZhi;
            case 3:
                return DuiHuan;
            case 4:
                return DuiHuanNoPass;
            case 5:
                return FanJiFen;
            case 6:
                return ZhuanZhang;
            case 7:
                return Commission;
            case 8:
                return Register;
            case 9:
                return ChouJiang;
            default:
                return null;
        }
    }
}
